//用户信息模块

const express = require('express')
const router = express.Router()
const userHandler = require('../router_handler/userinfo') //导入路由处理函数


// 导入验证更新用户信息数据的中间件
const expressJoi = require('@escook/express-joi')


const { getid } = require('../schema/user')
router.get('/userinfo', userHandler.getUserInfo) //获取用户信息

const { update_userinfo_schema } = require('../schema/user')
// expressJoi(update_userinfo_schema) 到达路由模块之前 进行验证 有问题报错
router.post('/upUserinfo', expressJoi(update_userinfo_schema), userHandler.upUserInfo) //获取用户信息



//重置密码
const { UpdataPassword } = require('../schema/user')
router.post('/updatepwd', expressJoi(UpdataPassword), userHandler.updatePassword)


// 更新头像
const { avatar } = require('../schema/user')
router.post('/update/avatar', expressJoi(avatar), userHandler.updateAvatar)

module.exports = router